package org.cjstudio.holypoopsgrs.test.util;

import org.cjstudio.holypoopsgrs_interface.game.model.HolyPoopsLeaderboard;
import org.cjstudio.holypoopsgrs_interface.game.model.HolyPoopsLeaderboardEntry;
import org.cjstudio.holypoopsgrs_interface.game.model.HolyPoopsPersonalRecord;

public class Stringify {

	public static String d(HolyPoopsLeaderboard leaderboard) {
		StringBuilder sb = new StringBuilder();
		sb.append("TYPE : " + leaderboard.type);
		sb.append("\n");
		
		sb.append("DATE : " + leaderboard.leaderboardDate);
		sb.append("\n");
		
		sb.append("ENTRIES : \n");
		for(int i=0; i<leaderboard.entries.size(); i++) {
			sb.append("ENTRY NO." + i);
			sb.append("\n");
			sb.append(d(leaderboard.entries.get(i)));
			sb.append("\n");
		}
		
		return sb.toString();
	}
	
	public static String d(HolyPoopsLeaderboardEntry entry) {
		StringBuilder sb = new StringBuilder();
		sb.append("NAME : " + entry.name);
		sb.append("\n");
		
		sb.append("HIGHEST : " + entry.highest);
		sb.append("\n");
		
		sb.append("RANK : " + entry.rank);
		sb.append("\n");
		
		sb.append("HIGHEST DATE : " + entry.highestDate);
		sb.append("\n");
		
		sb.append("MESSAGE : " + entry.message);
		
		return sb.toString();
	}
	
	public static String d(HolyPoopsPersonalRecord record) {
		StringBuilder sb = new StringBuilder();
		sb.append("NAME : " + record.name);
		sb.append("\n");
		
		sb.append("HIGHEST : " + record.highest);
		sb.append("\n");
		
		sb.append("RANK : " + record.rank);
		sb.append("\n");
		
		sb.append("HIGHEST DATE : " + record.highestDate);
				
		return sb.toString();
	}
}
